Using the menu command Format - Conditional formatting, the dialog allows you to define up to three conditions per cell, which must be met in order for the selected cells to have a particular format.
メニューから 書式 → 条件付き書式設定 を選択すると、ダイアログが開きます。このダイアログでは、セルごとに最高 3 つまでの条件を定義できます。これらの条件に適合しなければ、書式設定は適用されません。
![]() | To apply conditional formatting, AutoCalculate must be enabled. Choose Tools - Cell Contents - AutoCalculate (you see a check mark next to the command when AutoCalculate is enabled).
条件付き書式設定を適用するには、自動計算が有効になっていなければなりません。 ツール → セルの内容 → 自動計算 を選択してください。自動計算を有効にすると、コマンドの横にチェックマークが表示されます。 |
With conditional formatting, you can, for example, highlight the totals that exceed the average value of all totals. If the totals change, the formatting changes correspondingly, without having to apply other styles manually.
条件付き書式設定を使用すれば、たとえば、合計値が挿入されているセルの中から、すべての合計値の平均を超える合計だけを強調表示できます。合計値を変更すると、書式も自動的に変更されるため、スタイルを手動で割り当て直す必要がありません。
Select the cells to which you want to apply a conditional style.
条件付き書式を設定するセルを選択します。
Choose Format - Conditional Formatting.
メニュー 書式 → 条件付き書式設定 を選択します。
Enter the condition(s) into the dialog box. The dialog is described in detail in Office Help, and an example is provided below:
ダイアログボックスに条件を入力します。このダイアログボックスの詳細については、Office のヘルプを参照してください。ここでは条件付き書式設定の例だけを示します。
You want to give certain values in your tables particular emphasis. For example, in a table of turnovers, you can show all the values above the average in green and all those below the average in red. This is possible with conditional formatting.
表の中で、決まった基準で数値を強調することにしましょう。条件付き書式設定を使うと、例えば平均を超える売上額を緑、平均を下回る売上額を赤で表示することができます。
First of all, write a table in which a few different values occur. For your test you can create tables with any random numbers:
まず表に色々な数値を入力します。乱数を発生させて表を色々な数値で埋めることもできます:
In one of the cells enter the formula =RAND(), and you will obtain a random number between 0 and 1. If you want integers of between 0 and 50, enter the formula =INT(RAND()*50).
あるセルに数式 =RAND() を入力します。この数式で 0 から 1 までの乱数を発生させることができます。0 から 50 までの乱数を発生させるには、=INT(RAND()*50) とします。
Copy the formula to create a row of random numbers. Click the bottom right corner of the selected cell, and drag to the right until the desired cell range is selected.
数式をコピーして、乱数の行を作成します。このためには、選択したセルの右下隅 (小さな黒い四角があるところ) をクリックし、右方向にドラッグして、希望のセル範囲を選択します。
In the same way as described above, drag down the corner of the rightmost cell in order to create more rows of random numbers.
同様に、選択したセルの右下隅をクリックし、今度は下方向にドラッグして、乱数の範囲を広げます。
The next step is to apply a cell style to all values that represent above-average turnover, and one to those that are below the average. Ensure that the Styles and Formatting window is visible before proceeding.
この例に使うためにセルスタイルを 2 つ定義します。ひとつは平均を上回る売上額に割り当てるスタイル、もうひとつは平均を下回る額に割り当てるスタイルです。そのためにはまずスタイルと書式設定ウィンドウを呼び出します。
Click in a blank cell and select the command Format Cells in the context menu.
空白のセルをクリックした上でコンテキストメニューを呼び出し、セルの書式設定 を選択します。
In the Format Cells dialog on the Background tab, select a background color. Click OK.
ダイアログ セルの書式設定 の 背景 見出しページで、背景色を選択します。「OK」をクリックします。
In the Styles and Formatting window, click the New Style from Selection icon. Enter the name of the new style. For this example, name the style "Above".
スタイルと書式設定ウィンドウで 選択スタイルから新規作成 アイコンをクリックします。新しいスタイルの名前を入力します。この例では、「上」という名前をスタイルに付けます。
To define a second style, click again in a blank cell and proceed as described above. Assign a different background color for the cell and assign a name (for this example, "Below").
2 番目のスタイルを定義するには、もう一度、空のセルをクリックして、上記手順を繰り返します。別の背景色を割り当てて、今度は「下」という名前をスタイルに付けます。
In our particular example, we are calculating the average of the random values. The result is placed in a cell:
この例では、これまでに作成した乱数の平均を計算します。計算結果は 1 つのセルに表示します。
Set the cursor in a blank cell, for example, J14, and choose Insert - Function.
カーソルを空白のセル、たとえば J14 に置き、挿入 → 関数 を選択します。
Select the AVERAGE function. Use the mouse to select all your random numbers. If you cannot see the entire range, because the Function Wizard is obscuring it, you can temporarily shrink the dialog using the icon.
AVERAGE 関数を選択します。マウスを使って乱数の範囲を選択します。関数ウィザードが範囲に重なる場合は、数値入力ボックス横の拡大と縮小ボタンでダイアログを縮小表示にすることができます。
Close the Function Wizard with .
で関数ウィザードを閉じます。
Now you can apply the conditional formatting to the sheet:
あとは条件付き書式設定を表に適用するだけです:
Select all cells with the random numbers.
乱数が入力されている全てのセルを選択します。
Choose the Format - Conditional Formatting command to open the corresponding dialog.
コマンド 「書式」→「条件付き書式設定」を選択します。ダイアログ「条件付き書式設定」が開きます。
Define the condition as follows: If cell value is less than J14, format with cell style "Below", and if cell value is greater than or equal to J14, format with cell style "Above".
条件を設定します: 値が J14 より小さい場合はセルスタイル「赤」、大きい場合は「緑」を割り当てます。
To apply the conditional formatting to other cells later:
条件付き書式設定を後で別のセルにも適用させることにします:
Click one of the cells that has been assigned conditional formatting.
条件付き書式が割り当てられているセルをクリックします。
Copy the cell to the clipboard.
このセルをクリップボードにコピーします。
Select the cells that are to receive this same formatting.
条件付き書式を割り当てるセルを選択します。
Choose Edit - Paste Special. The Paste Special dialog appears.
「編集」→「形式を選択して貼り付け」を選択します。ダイアログ「形式を選択して貼り付け」が開きます。
In the Selection area, check only the Formats box. All other boxes must be unchecked. Click OK.
範囲 選択 では、チェックボックス 書式 のみをオンにします。別のすべてのチェックボックスはオフにします。OK をクリックします。